<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>清除浮动</title>
    <style>
      .one {
        background-color: red;
        float: left;
        width: 200px;
        height: 200px;
      }
      .two {
        background-color: yellow;
        float: left;
        width: 200px;
        height: 200px;
      }
      .four {
        clear: both; /* 额外标签法清除浮动 */
      }
    </style>
  </head>
  <body>
    <div class="three">
      <div class="one"></div>
      <div class="two"></div>
      <div class="four"></div>
    </div>
  </body>
</html>
